/**********************************************************************
 *@Project： clouddemo
 *@File: EntityListener
 *@Date: 2017/4/28
 *@Copyright (C) 2013-2017 http://www.posun.cn. All Rights Reserved.
 ***********************************************************************
 *注意： 本内容仅限于深圳市普盛实业有限公司内部使用，禁止外泄
 **********************************************************************
 */
package com.posun.edu.system.entity;

import com.posun.framework.orm.entity.AbstractEntity;
import com.posun.framework.orm.handle.IEventListener;
import org.apache.ibatis.reflection.MetaObject;

/**
 * <p>
 * TODO<br>
 *
 * @author YL
 * @version 1.0
 * @createTime 2017/4/28 15:54
 * @ChangeLog
 */
public class EntityListener implements IEventListener {
    @Override
    public void preInsert(MetaObject metaObject) {
        System.out.println(metaObject.getOriginalObject().getClass());
        if(metaObject.getOriginalObject() instanceof AbstractEntity) {
            System.out.printf("this is an AbstractEntity");
        }
    }

    @Override
    public void preUpdate(MetaObject metaObject) {

    }

    @Override
    public void preRemove(MetaObject metaObject) {

    }

    @Override
    public void postInsert(MetaObject metaObject) {

    }

    @Override
    public void postUpdate(MetaObject metaObject) {

    }

    @Override
    public void postRemove(MetaObject metaObject) {

    }
}
